//
// Created by ycl on 2024/11/6.
//

#ifndef PROJECT_GLOB_H
#define PROJECT_GLOB_H

#include "stm32f1xx.h"
#include"stm32f1xx_hal_tim.h"
#include <stdbool.h>
#include <stdio.h>

#define PROJECT_CUSTOM_METHOD_EXCUTE_FLAG (ProjectCustomMethodExcuteFlag) //工程自定义函数执行标志
#define PROJECT_System_METHOD_EXCUTE_FLAG (ProjectSystemMethodExcuteFlag) //工程系统函数执行标志
#define PROJECT_ERR(msg) (fprintf((stderr), ("Error: %s\n"), (msg)))

#define PROJECT_DEF_GPIO_PIN GPIO_PIN_All
#define PROJECT_DEF_GPIO_MODE GPIO_MODE_OUTPUT_PP
#define PROJECT_DEF_GPIO_PULL GPIO_NOPULL
#define PROJECT_DEF_GPIO_SPEED GPIO_SPEED_FREQ_LOW

typedef struct
{
    TIM_HandleTypeDef htim1;
    TIM_HandleTypeDef htim2;
    TIM_HandleTypeDef htim3;
    TIM_HandleTypeDef htim4;
}ProjectParam;


static uint64_t ProjectCustomMethodExcuteFlag = (0x0000000000000000);
static uint64_t ProjectSystemMethodExcuteFlag = (0x0000000000000000);
static uint64_t ProjectSensorStatusFlag = (0xFFFFFFFFFFFFFFFF);


/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

void projectInit(void);

void setProjectFlag(uint64_t* projectFlag, uint8_t position, bool value);
bool getProjectFlag(uint64_t* projectFlag, uint8_t position);



#endif //PROJECT_GLOB_H
